<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>用户管理</title>
    <link rel="stylesheet" type="text/css"
          href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css"
          href="easyui/demo/demo.css">
    <script type="text/javascript"
            src="common/lib/jquery-1.8.3.min.js"></script>
    <script type="text/javascript"
            src="easyui/jquery.min.js"></script>
    <script type="text/javascript"
            src="easyui/jquery.easyui.min.js"></script>
    <style>
        .divs{
            width: 100%;
        }
        .divs>div{
            width: 48%;
            float: left;
        }
    </style>
</head>

<body>
<div style="margin: 5px 0;"></div>
<div class="divs">
    <div>
        <table id="dg" title="打 卡 成 功" style="width: 100%;"
               data-options="rownumbers:true,singleSelect:true,pagination:true,
				onClickRow: onClickRow,url:'/OASystem/Attendance/easyuiGetData',method:'get',toolbar:'#tb'">
            <thead>
            <tr>
                <th style="width: 25%" data-options="field:'eId',align:'center'">工 号</th>
                <th style="width: 25%" data-options="field:'name',align:'center'">姓 名</th>
                <th style="width: 50%" data-options="field:'dakaTime',align:'center'">打卡时间</th>
            </tr>
            </thead>
        </table>
        <div id="tb" style="font-size: 17px;height: 50px;padding-top: 9px;">

            <div style="margin-top: 10px">
                &emsp;姓名&emsp;<input style="font-size: 15px;" type="text" name="standard.name" id="emp_name"/>&emsp;&emsp;
                工号&emsp;<input style="font-size: 15px" type="text" name="standard.minWeight" id="emp_eId"/>&emsp;&emsp;
                <a id="standardQueryBtn" href="javascript:void(0)"
                   class="easyui-linkbutton" data-options="iconCls:'icon-search'">搜索</a>
            </div>
        </div>
    </div>

    <div style="margin-left: 3%;">
        <table id="dg1" title="迟 到 或 早 退" style="width: 100%;"
               data-options="rownumbers:true,singleSelect:true,pagination:true,
				onClickRow: onClickRow,url:'/OASystem/Attendance/easyuiGetDataNot',method:'get',toolbar:'#tb1'">
            <thead>
            <tr>
                <th style="width: 25%" data-options="field:'eId',align:'center'">工 号</th>
                <th style="width: 25%" data-options="field:'name',align:'center'">姓 名</th>
                <th style="width: 50%" data-options="field:'dakaTime',align:'center'">打卡时间</th>
            </tr>
            </thead>
        </table>
        <div id="tb1" style="font-size: 17px;height: 50px;padding-top: 9px;">

            <div style="margin-top: 10px">
                &emsp;姓名&emsp;<input style="font-size: 15px;" type="text" name="standard.name" id="emp_name1"/>&emsp;&emsp;
                工号&emsp;<input style="font-size: 15px" type="text" name="standard.minWeight" id="emp_eId1"/>&emsp;&emsp;
                <a id="standardQueryBtn1" href="javascript:void(0)"
                   class="easyui-linkbutton" data-options="iconCls:'icon-search'">搜索</a>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        var pager = $('#dg').datagrid().datagrid('getPager');
        var pager = $('#dg1').datagrid().datagrid('getPager');
    })

    var editIndex = undefined;

    function endEditing() {
        if (editIndex == undefined) {
            return true
        }
        if ($('#dg').datagrid('validateRow', editIndex)) {
            var ed = $('#dg').datagrid('getEditor', {index: editIndex, field: 'productid'});
            var productname = $(ed.target).combobox('getText');
            $('#dg').datagrid('getRows')[editIndex]['productname'] = productname;
            $('#dg').datagrid('endEdit', editIndex);
            editIndex = undefined;
            return true;
        } else {
            return false;
        }
    }

    function onClickRow(index) {
        if (editIndex != index) {
            if (endEditing()) {
                $('#dg').datagrid('selectRow', index)
                    .datagrid('beginEdit', index);
                editIndex = index;
            } else {
                $('#dg').datagrid('selectRow', editIndex);
            }
        }
    }

    $("#standardQueryBtn").click(function () {
        //$("#dg") 获取easui的数据表格   datagrid("load" 重新加载表格 后面的几个数据是请求的参数
        $("#dg").datagrid("load", {
            "name": $("#emp_name").val(),
            "eId": $("#emp_eId").val()
        });
    });
    $("#standardQueryBtn1").click(function () {
        //$("#dg") 获取easui的数据表格   datagrid("load" 重新加载表格 后面的几个数据是请求的参数
        $("#dg1").datagrid("load", {
            "name": $("#emp_name1").val(),
            "eId": $("#emp_eId1").val()
        });
    });
</script>
</body>

</html>